package com.example.user.myhjjf_app.view;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.ActivityUtils;
import com.example.user.myhjjf_app.R;
import com.example.user.myhjjf_app.model.Model_Content;
import com.example.user.myhjjf_app.model.Model_Regional;
import com.example.user.myhjjf_app.model.Model_Tagging;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class Activity_Tagmas extends AppCompatActivity {
    Model_Tagging.ValueBean.ArrayBean.DetailsBean detailsBean;
    @BindView(R.id.btn_back)
    LinearLayout btnBack;
    @BindView(R.id.tx_title)
    TextView txTitle;
    @BindView(R.id.btn_menu)
    LinearLayout btnMenu;
    @BindView(R.id.tv_bm)
    TextView tvBm;
    @BindView(R.id.bt_ptsb)
    Button btPtsb;
    @BindView(R.id.bt_yxsb)
    Button btYxsb;
    @BindView(R.id.bt_wxsb)
    Button btWxsb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity__tagmas);
        ButterKnife.bind(this);
        Bundle bu = getIntent().getExtras();
        detailsBean = (Model_Tagging.ValueBean.ArrayBean.DetailsBean) bu.getSerializable("detailsBean");
        txTitle.setText(detailsBean.getName());
        tvBm.setText(detailsBean.getCode());
    }

    @OnClick({R.id.btn_back, R.id.bt_ptsb, R.id.bt_yxsb, R.id.bt_wxsb})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finish();
                break;
            case R.id.bt_ptsb:
                Model_Regional.getRegional().setSiteId(detailsBean.getId());
                ActivityUtils.startActivity(Activity_ptsb.class);
                break;
            case R.id.bt_yxsb:
                Model_Regional.getRegional().setSiteId(detailsBean.getId());
                ActivityUtils.startActivity(Activity_yxsb.class);
                break;
            case R.id.bt_wxsb:
                Model_Regional.getRegional().setSiteId(detailsBean.getId());
                ActivityUtils.startActivity(Activity_wxsb.class);
                break;
        }
    }
}
